package pers.qianyu.diytomcat.catalina;

import cn.hutool.core.date.*;
import cn.hutool.log.*;
import pers.qianyu.diytomcat.util.*;

/**
 * @author mizzle rain
 * @date 2021-01-07 17:01
 */
public class Server {
    private Service service;

    public Server() {
        this.service = new Service(this);
    }

    public void start() {
        TimeInterval timeInterval = DateUtil.timer();
        LogUtils.logJvm(LogFactory.get());
        init();
        LogFactory.get().info("Server startup in {} ms", timeInterval.intervalMs());
    }

    private void init() {
        service.start();
    }

    /************** automatic generated *****************/
    public Service getService() {
        return service;
    }

    public void setService(Service service) {
        this.service = service;
    }
}
